#pragma once
#ifndef MODEL_HPP
#define MODEL_HPP

#include "MeshLoader.hpp"
#include <string>

namespace Data {
class ModelObject {
public:
  using MeshRef = std::shared_ptr<Mesh>;
  using Vertices = std::vector<Vertex>;
  using Indices = std::vector<uint32_t>;

  // Create a empty model
  ModelObject(const std::string &name) : _name(name) {}

  void CreateMesh(const Vertices &vertices, const Indices &indices);
  std::string getName() const { return _name; }

  MeshRef getMesh() const { return _meshes.front(); }

  void Remove() {
    for (auto &val : _meshes) {
      val.reset();
    }
    _meshes.clear();
  }
  ~ModelObject() { Remove(); }

private:
  std::vector<MeshRef> _meshes;
  std::string _name;
};
} // namespace Data

#endif